/**
 * 
 */
package com.hp.sso.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.social.SocialAutoConfigurerAdapter;
import org.springframework.context.annotation.Configuration;
import org.springframework.social.connect.ConnectionFactory;

import com.hp.sso.connet.ConnectFactory;

/**
 * @author zhailiang
 *
 */
@Configuration
@ConditionalOnProperty(prefix = "qq", name = "app-id")  //按需加载 当配置文件有 qq.app-id才会加载此配置
public class QQAutoConfig extends SocialAutoConfigurerAdapter {
	
	private String providerId;
	
	private String appId;
	
	private String appSecret;
	

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.springframework.boot.autoconfigure.social.SocialAutoConfigurerAdapter
	 * #createConnectionFactory()
	 */
	@Override
	protected ConnectionFactory<?> createConnectionFactory() {
		return new ConnectFactory(providerId, appId, appSecret);
	}


	public String getProviderId() {
		return providerId;
	}


	public void setProviderId(String providerId) {
		this.providerId = providerId;
	}


	public String getAppId() {
		return appId;
	}


	public void setAppId(String appId) {
		this.appId = appId;
	}


	public String getAppSecret() {
		return appSecret;
	}


	public void setAppSecret(String appSecret) {
		this.appSecret = appSecret;
	}
}
